﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'PRC_TB_ALERTS_IN')
	BEGIN
		DROP  Procedure  dbo.PRC_TB_ALERTS_IN
	END

GO

CREATE Procedure dbo.PRC_TB_ALERTS_IN
	(
		@TA_NAME varchar(250),
		@TA_USER_ID int,
		@TA_STATE int,
		@TA_SLEEP_DATE datetime,
		@TA_TYPE int
	)

AS

insert into TB_ALERTS
(TA_USER_ID,
 TA_NAME,
 TA_STATE,
 TA_SLEEP_DATE,
 TA_TYPE)
values
(@TA_USER_ID,
 @TA_NAME,
 @TA_STATE,
 @TA_SLEEP_DATE,
 @TA_TYPE)
 
select @@identity

GO

GRANT EXEC ON dbo.PRC_TB_ALERTS_IN TO PUBLIC

GO